import request from '@/request/request.js'

// 首页数据的请求
export const GetHomeList = () => request.get('/index/index')
// 品牌详情中的产品列表
export const GetBrandList = (params) => request.get('/goods/list', { params })
// 品牌详情
export const GetBrandDetail = (params) => request.get('/brand/detail', { params })
// 分类数据获取
export const GetChannelDetail = (params) => request.get('/goods/category', { params })
// 获取搜索弹出框的数据
export const GetSearchPopupData = () => request.get('/search/index')
// 实时搜索  搜索提示 获取实时搜索的文本提示的数据列表

// export const GetSearchTipsListData = (xxx) => request.get("/search/helper",{
//     params: xxx     // 这个xxx是一个对象，axios文档上要求的 get需要加{}包裹着params
// })

// export const GetSearchTipsListData = (params) => request.get("/search/helper",{
//     params: params
// })

export const GetSearchTipsListData = (params) => request.get('/search/helper', { params })
//  商品数据展示
export const GetGoodsListData = (params) => request.get('/goods/list', { params })
// post
// 清除历史记录
export const ClearHistoryData = () => request.post('/search/clearhistory')
// 用户登录 注册
// post 不需要加{}包裹着params 可以直接写键值对 params
export const GoLogin = (params) => request.post('/auth/loginByWeb', params)
// 商品详情数据
export const GetGoodsDetailData = (params) => request.get('/goods/detail', { params })
// 相关产品
export const GetGoodsRelatedData = (params) => request.get('/goods/related', { params })
// 获取购物车产品数量
export const GetGoodsCount = () => request.get('/cart/goodscount')
// 加入购物车
export const AddProductToCart = (params) => request.post('/cart/add', params)
// 获取购物车数据
export const GetCartData = () => request.get('/cart/index')
// 点击切换商品选中状态
export const ChangeGoodsChecked = (params) => request.post('/cart/checked', params)
// 商品步进器
export const StepperChange = (params) => request.post('/cart/update', params)
// 删除商品
export const DelGood = (params) => request.post('/cart/delete', params)

// 专题 页面数据请求
export const GetTopicList = (params) => request.get('/topic/list', { params })
